<template>
    <div class="swiper_content">
        <div class="swiper-wrapper">
            <div class="swiper-slide" v-for="(item,index) in datas" :key="index">
                <div class="count">
                    <img :src="item">
                </div>
            </div>
        </div>
    </div>
</template>

<script>
import Swiper from 'swiper';
import 'swiper/swiper-bundle.css';
import {reactive,toRefs,onMounted} from 'vue'
export default {
    props:{
        pic:Array
    },
    setup(props){
        const state=reactive({
             datas:props.pic
        })
        onMounted(async()=>{
            new Swiper('.swiper_content',{
                slidesPerView: 3,//数量
                observer:true,
                direction : 'horizontal',//设置水平还是垂直vertical
            })
            
            
         })
         return{
             ...toRefs(state)
         }
      }
    
};
</script>

<style>
    .swiper_content{
        width: 350px;
        height: 200px;
        margin: 12px auto;
        animation:fadeInRight;
        animation-duration: 1s;
    }
    .swiper_content .swiper-slide {
        width:100px;
    }
    .swiper_content .swiper-slide img{
       width: 105px;
       height: 190px;
       border-radius: 5px;
       object-fit: cover;
    }
</style>